const { defineConfig } = require('@vue/cli-service')

module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
  configureWebpack: {
    externals: {
      'mars3d-cesium': 'Cesium',
      'mars3d': 'mars3d'
    }
  },
  chainWebpack: (config) => {
    // 处理Mars3D相关资源
    config.module
      .rule('cesium')
      .test(/\.(glsl|vs|fs)$/)
      .use('raw-loader')
      .loader('raw-loader')
      .end()
  }
})